package org.example.test;

import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
@Data//这是lombok注解，可以自动生成属性的getter/setter,equals/hashcode,toString
public class Person {

    @Autowired
    private Mobile mobile;

    @Autowired
    private Mobile m2;

    @Autowired
    @Qualifier("m2")
    private Mobile m;

    @Resource
    private Mobile m1;

    @Resource(name = "m1")
    private Mobile mm;

    @Resource
    private Mobile m0;

    //不使用lombok

//    public Mobile getMobile() {
//        return mobile;
//    }
//
//    public void setMobile(Mobile mobile) {
//        this.mobile = mobile;
//    }
}
